<template>
      <h2>用户理财明细页</h2>
      <table class="table table-bordered" border="1">
          <thead style="background-color:aqua">
              <tr>
                  <th>用户登录账号</th>
                  <th>理财产品名称</th>
                  <th>年收益</th>
                  <th>购买金额</th>
                  <th>购买时间</th>
              </tr>
          </thead>
          <tbody>
               <tr v-for="item in info" >
                  <td>{{item.UL_Name}}</td>
                  <td>{{item.F_name}}</td>
                  <td>{{item.F_APY}}</td>
                  <td>{{item.UF_Money}}</td>
                  <td>{{item.UF_Date.substring(0,10)}}</td>
               </tr>
          </tbody>
      </table>
</template>

<script setup lang="ts">
import {ref,onMounted} from 'vue';
import axios from 'axios';

import {useRoute} from 'vue-router'

//创建路由对象
const route = useRoute();

onMounted(()=>{
    LoadData();
})

//创建
const info = ref([{
    UL_Name:"",
    F_name:"",
    F_APY:0,
    UF_Money:0,
    UF_Date:""
}]);

const LoadData =()=>{
    axios({
        url:"https://localhost:44337/api/Finans/ShowAllUserFinanInfo",
        method:"get",
        params:{
           Fid:route.params.Fid
        }
    }).then((res)=>{
        console.log(res.data);
        info.value = res.data;
        
        
       
    }).catch((err)=>{
        console.log(err);
    })
}
</script>